<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>创建合同订单</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
    <script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common.css">
    <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
    <script type="text/javascript">
    $(document).ready(function(){
    	var form = $("#inputForm");  
        form.validate();//验证指定的表单
    	$("#financeCurrency").select2();
    	$("#itemID").select2();
    	$("#ognizationID").select2();
   		$("#okButton").click(function(){
    		if (form.valid()) {//如果表单验证成功，则进行提交。  
    		$("#showHtml").addClass("showHtml");
            $("#okHead").show();
            $("#createHead").hide();  
            $("#advanceDueDate").removeClass("laydate-icon");
            $("#appDate").removeClass("laydate-icon");
            return false;
          	}
     	});
    });
    
    </script>
    <style type="text/css">
    .linkBox{
	color:#0a6dca;
	cursor:pointer;
	text-decoration:underline;
	}
	.showHtml input{
	border:none;
	background-color:inherit;
	color:#333;
	}
    </style>
</head>
<form id="inputForm">
<body>   

<!-- 确认画面头部 -->
<div id="okHead" class="layerHeader clearfix">	      
             <p class="headerTitle"><spring:message code="init_finance_create_viewInitFinance"/></p>    
    <div class="headerButton clearfix">
	    <!-- 编辑 --> 
			<%-- <button type="button" onclick="window.location.href='${ctx}/init/finance/createInit?id=${settlementEntity.id}'"><spring:message code="init_finance_create_editBtn"/></button> --%>
        <!-- 取消 -->
          <button type="button" onclick="closeWin()"><spring:message code="purchaseAdvance_edit_cancle"/></button>
    </div>
</div>

<div id="showHtml" class="smOrderBox showHtml">
		
        <input type="hidden" id="id" name="id" value="">
        <div class=" clearfix" >
        	<p class="title" style="margin-top: 2px"><spring:message code="init_finance_create_ognizationInfo"/></p>
        </div>
    <div class="items clearfix">
        <div class="col-50 clearfix">
        <!-- 组织机构名 -->
            <p class="tit" style="width: 80px"><spring:message code="init_finance_create_ognizationName"/></p>
            <p>${settlementEntity.ognization.ognizationName }</p>
        </div>
    </div>
    <div id="addressHtml" class="items clearfix showHtml">
        <div class="clearfix">
        <!-- 组织机构地址  -->
            <p class="tit" style="width: 80px"><spring:message code="init_finance_create_ognizationAddress"/></p>
             <input type="text" style="width: 500px;" value="${settlementEntity.ognization.ognizationAddress }" disabled="disabled">
        </div>
    </div>
    <div id="contactHtml" class="items clearfix showHtml" >        	
                <div class="col-50 clearfix">
                <!-- 主联系人 -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_contactPhone"/></p>
                    <input type="text" value="${settlementEntity.ognization.contactPerson }" disabled="disabled">
                </div>
                
                <div class="col-50 clearfix">
                <!-- 联系电话 -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_contactPhone"/></p>
                    <input type="text" value="${settlementEntity.ognization.contactPhone }" disabled="disabled">
                </div>
            </div>
    <div class=" clearfix" >
        	<p class="title" style="margin-top: 2px"><spring:message code="init_finance_create_itemInfo"/></p>
        </div>
            <div id="itemHtml" class="items clearfix" >        	
                <div class="col-50 clearfix">
                <!-- 款项类别 -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_itemName"/></p>
                    <c:choose>
	                    <c:when test="${settlementEntity.realDebitAmount != null}">
                    		<p><spring:message code="init_finance_create_initialPayment"/></p>
	                    </c:when>
	                    <c:otherwise>
		                    <p><spring:message code="init_finance_create_initialReceivables"/></p>
	                    </c:otherwise>
                    </c:choose>
                </div>
                
                <div class="col-50 clearfix">
                <!-- 结算货币 -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_financeCurrency"/></p>
                    <p>${fns:getDictName(settlementEntity.financeCurrency)}</p>
                </div>
            </div>
            <div class="items clearfix">        	
                <div class="col-50 clearfix">
                <!-- 款项金额  -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_financeAmount"/></p>
                    <p><fmt:formatNumber value="${settlementEntity.realDebitAmount}${settlementEntity.realCreditAmount}" pattern="#,##0.00###"/></p>
                </div>
            </div>
            <div class="items clearfix showHtml">
                
        		<div class="clearfix">
        		<!-- 备注 -->
            		<p class="tit" style="width: 80px"><spring:message code="init_finance_create_remarks"/></p>
            		<textarea name="remarks" style="width:630px;height: 60px" disabled="disabled">${settlementEntity.remarks }</textarea>
        		</div>
    	</div>
    	<div class="items clearfix">        	
                <div class="col-50 clearfix">
                <!-- 创建人员  -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_creator"/></p>
                    <input type="text" value="${settlementEntity.createBy.firstName }${settlementEntity.createBy.lastName }" disabled="disabled">
                </div>
                <div class="col-50 clearfix">
                <!-- 创建时间  -->
                    <p class="tit" style="width: 80px"><spring:message code="init_finance_create_createDate"/></p>
                    <input type="text" value='<fmt:formatDate value="${settlementEntity.createDate }" pattern="yyyy-MM-dd"/>' disabled="disabled">
                </div>
            </div>
</div>
</form>
<script>
	window.onload = function(){
	$('.tableScrollSm').css('height','325px')
	$('td input').each(function(){
		var tdH = $(this).parents('td').height()
		$(this).css('height',tdH)
		})
	}
	var tableW = $('.tableHead').outerWidth();
	$('.tableScroll').css('width',tableW + 18 + 'px')

</script>
</body>
</html>
